<input type="hidden" id="delete_album_status" value="<?php echo $this->session->flashdata('delete_album_status'); ?>" />
<script type="text/javascript">
  $(document).ready(function() {
	var delete_album_status = $.trim($('#delete_album_status').val());
	if (delete_album_status == 1) {
	  toastr.success('Successfully deleted album !');
	  return false;
	}
	if (delete_album_status == 2) {
	  toastr.error('Error occured. Try again !');
	  return false;
	}
  });
</script>

<div class="page" style="min-height: 500px;">
  <div class="page-container">
    <div class="container">
      <div class="row">
        <div class="span12">
          <div class="btn-group" style="float: right; margin-bottom: 10px;">
            <a href="<?php echo base_url('album/create'); ?>" class="btn">Create album</a>
          </div>
          <h4 class="header">Albums</h4>
        </div>
      </div>
      <div class="row">
        <div class="span3">
          <div class="sidebar">
            <ul class="col-nav span3">
              <li <?php if ($type == '') { ?> style="background-color: #EEE;" <?php } ?>><a href="<?php echo base_url('albums'); ?>"><i class="pull-right icon-cog"></i>All Albums</a></li>
              <li <?php if ($type == 'my') { ?> style="background-color: #EEE;" <?php } ?>><a href="<?php echo base_url('albums/my'); ?>"><i class="pull-right icon-user"></i>My Albums</a></li>
            </ul>
          </div>
          <div class="clearfix"></div>
          <div class="filters">
            <h5><a style="text-decoration: none; color: #555; font-weight: bold;">Counter</a></h5>
            <span class="pull-right"><?php echo $albums_count; ?></span>
            <label for="cb3">Total Albums</label>
            <span class="pull-right"><?php echo $total_photos; ?></span>
            <label for="cb3">Total Photos</label>
            <span class="pull-right"><?php echo $total_videos; ?></span>
            <label for="cb3">Total Videos</label>
          </div>
        </div>
        <div class="span9">
		  <?php if (!empty($albums_data) && is_array($albums_data)) { ?>
  		  <ul class="thumbnails">
			  <?php foreach ($albums_data as $album) { ?>
				<a href="<?php echo base_url('album/' . $album['album_id']); ?>" style="text-decoration: none;">
				  <li class="span3">
					<div class="thumbnail album_thumbanil">
					  <?php if (!empty($album['album_cover_photo'])) { ?>
	  				  <img title="<?php echo $album['album_name']; ?>" class="album_div_img" src="<?php echo base_url('assets/albums/' . $album['album_id'] . '/' . substr($album['album_cover_photo'], 0, 32) . '_thumb.jpg'); ?>" />
					  <?php } else { ?>
	  				  <img title="<?php echo $album['album_name']; ?>" class="album_div_img" src="<?php echo base_url('assets/img/no_image_available.jpg'); ?>" />
					  <?php } ?>
					  <h6><?php echo mb_substr($album['album_name'], 0, 25) . '...'; ?></h6>
					</div>
				  </li>
				</a>
			  <?php } ?>
  			<div id="albums_more"></div>
  		  </ul>
			<?php if ($albums_count > $limit) { ?>
			  <input type="hidden" name="album_type" id="album_type" value="<?php echo $type; ?>" />
			  <input type="hidden" name="album_offset" id="album_offset" value="<?php echo $limit; ?>" />
			  <a id="load_more_buttons" style="text-decoration: none; cursor: pointer; float: right; color: black;" onclick="return load_more_albums();" title="Load more albums">
				<img id="loading_animation" src="<?php echo base_url('assets/img/loading_black.gif'); ?>" style="display: none;"/>&nbsp;<b>more</b>&nbsp;<i class="icon-large icon-chevron-down"></i>
			  </a>
			<?php } ?>
		  <?php } else { ?>
  		  No albums !
		  <?php } ?>
        </div>
      </div>
    </div>
  </div>
</div>
